{% import "macro.html.twig" as web_macro %}
<li id="post-{{ post.id }}" data-user-id="{{ author.id }}" class="thread-post thread-subpost media user-id-{{author.id}} {% if less|default(false) and loop.index > 5 %}hide{% endif %}"
  data-author-name="{{ author.nickname }}">
  <div class="media-left">
    {{ web_macro.user_avatar(author, 'user-avatar', 'avatar-sm', true) }}
  </div>
  <div class="media-body" style="overflow: visible">
    <div class="metas">
      {% if canAccess|default(false) or (app.user.isLogin() and app.user.id != post.userId and not is_reported(replyReportType, post.id)) %}
        <div class="thread-post-manage-dropdown dropdown pull-right">
          <a href="javascript:;" class="dropdown-toggle color-gray" data-toggle="dropdown"><span class="glyphicon glyphicon-collapse-down"></span></a>
          <ul class="dropdown-menu">
            {% if canAccess|default(false) %}
              <li>
                <a href="javascript:" class="js-delete-post" data-review-id="{{ post.id }}" data-for="#post-{{ post.id }}">{{'course.reviews.delete_btn'|trans}}</a>
              </li>
            {% endif %}
            {% if app.user.isLogin() and app.user.id != post.userId and not is_reported(replyReportType, post.id) %}
              <li id="{{ 'js-review-reply-modal-' ~ post.id }}">
                <a class="js-report-post"
                   href="#modal"
                   data-toggle="modal"
                   data-url="{{ path('common_report_tags_modal', {targetType: replyReportType, targetId: post.id, modalTarget: 'js-review-reply-modal-'~ post.id, contentTarget: 'js-review-reply-after-' ~ post.id }) }}"
                >举报</a>
              </li>
            {% endif %}
          </ul>
        </div>
      {% endif %}

      <a href="{{ path('user_show', {id:author.id}) }}">{{ author.nickname }}</a>
      <span class="bullet">•</span>
      <span class="color-gray">{{post.createdTime|smart_time}} </span>
    </div>
    <div class="editor-text" style="white-space: pre-wrap;">{{ post.content|cdn|raw }}{% if app.user.isLogin() and app.user.id != post.userId and is_reported(replyReportType, post.id) %}<span style="color: red;">({{ ('已举报')|trans }})</span>{% endif %}<span id="{{ 'js-review-reply-after-' ~ post.id }}" style="color: red;"></span></div>
    <div class="thread-post-interaction">&nbsp;</div>
  </div>
</li>
